//品牌列表.js
function search(){
	     document.getElementsByName("name")[0].value=(document.getElementsByName("name")[0].value).trim(); 
 	     document.getElementsByName("cname")[0].value=(document.getElementsByName("cname")[0].value).trim(); 
         $("#page").val("1");
         $("#query_brand_form").submit();
	 }	
function toIsEmpty(){
    document.getElementsByName("name")[0].value= "";
    document.getElementsByName("cname")[0].value= "";
    $("#startDate").val("");
    $("#endDate").val("");
}

/*查看*/
function look_product(title,url,id,w,h){
	        var index = layer.open({
	            type: 2,
	            title: title,
	            content: url
	        });
	        layer.full(index);
}
function delete_brand(id){
	layer.confirm("确定删除此品牌?",function(){
		layer.closeAll('dialog');
		var layer_load_window = layer.load(2); 
		$.ajax({
			url : path + "/brand/delete_brand",
			cache : false,
			type : 'post',
			dataType : 'html',
			data : {
				"id":id
			},
			error : function() {
				layer.alert("操作失败!");
			},
			success : function(message) {
 				if(message == "200"){
 					$("#query_brand_form").submit();
 				}else if(message == "500"){
 					layer.alert("系统繁忙！");
 				}else{
 					layer.alert(message);
 				}
			},
			complete: function(XMLHttpRequest, textStatus) {
				layer.close(layer_load_window);
			}
		});	
	});
}